package com.hermes.biz.service.login.impl;

import com.hermes.biz.common.model.result.UserResultDO;
import com.hermes.biz.common.model.user.UserDO;
import com.hermes.biz.common.util.login.UserInfoMapUtil;
import com.hermes.biz.manager.user.UserOperateManager;
import com.hermes.biz.service.login.LoginService;

public class LoginServiceImpl implements LoginService{

	private UserOperateManager userOperateManager;
	
	
	public UserResultDO checkUserLoginInfo(UserDO userDO) {

		UserResultDO result = new UserResultDO();
		String userName= userDO.getUserName();
		long userId = UserInfoMapUtil.getUserInfoMapUtil().getIdNumInMap(userName); 
		if(userId==0){
			result = userOperateManager.getSingleUserByUserName(userName);
		}
		else{
			result= userOperateManager.getSingleUserByUserId(userId);
		}
		return result;
	}

	public UserResultDO registerNewUser(UserDO userDO) {
		// TODO Auto-generated method stub
		return null;
	}

	public UserOperateManager getUserOperateManager() {
		return userOperateManager;
	}

	public void setUserOperateManager(UserOperateManager userOperateManager) {
		this.userOperateManager = userOperateManager;
	}

}
